<template>
	<view class="shop-foot-box">
		<view class="cont-l">
			<view class="btn" @click="navToKefu">
				<view class="icon" style="background-image: url(./static/images/icon_kefu.png);"></view>
				<view class="txt">客服</view>
			</view>
			<view class="btn">
				<view class="icon" @click="navToSd" style="background-image: url(./static/images/icon_sd.png);"></view>
				<view class="txt">商豆</view>
			</view>
			<template v-if="type==1">
				<view class="btn" @click="navToOrder">
					<view class="icon" style="background-image: url(./static/images/icon_order.png);"></view>
					<view class="txt">订单</view>
				</view>
			</template>
			<template v-else-if="type==2">
				<view class="btn" @click="toHome">
					<view class="icon" style="background-image: url(./static/images/icon_home.png);"></view>
					<view class="txt">首页</view>
				</view>
			</template>
		</view>
		<service ref="service"/>
	</view>
</template>

<script>
	import service from "@/components/shopKefu.vue"
	export default {
		name:"shopTabbar",
		props:{
			type: {
				type: String,
				default: '1'
			},
		},
		data() {
			return {
				
			};
		},
		components:{service},
		methods:{
			toHome() {
				uni.navigateTo({
					url: "/pages/shop/index"
				})
			},
			navToOrder() {
				uni.navigateTo({
					url: "/pages/shop/order"
				})
			},
			navToSd() {
				uni.navigateTo({
					url: "/pages/sd/show"
				})
			},
			navToKefu() {
				// this.$api.msg('敬请期待')
				// location.href="https://0.maikengwei.cn/tS";
				this.$refs['service'].open()
			},
		}
	}
</script>

<style lang="scss" scoped>
.shop-foot-box {
			background-color: #FFFFFF;
			box-shadow: 0 -1rpx 15rpx 1rpx rgba(87, 69, 43, 0.12);
			width: 100%;
			height: 110rpx;
			padding: 12rpx 0;
			box-sizing: border-box;
			position: fixed;
			bottom: 0;
			left: 0;
			display: flex;

			.cont-l {
				flex: 1;
				display: flex;
				padding: 0 3%;

				.btn {
					flex: 1;
					text-align: center;
					padding: 5rpx 0;

					.icon {
						height: 34rpx;
						background-size: auto 100%;
						background-position: center;
						background-repeat: no-repeat;
					}

					.txt {
						font-size: 24rpx;
						color: #808080;
						margin-top: 10rpx;
					}
				}
			}

			.cont-r {
				width: 62%;
				text-align: center;
				padding: 0 18rpx;

				.btn {
					height: 86rpx;
					line-height: 86rpx;
					border-radius: 43rpx;
					letter-spacing: 8rpx;
					color: #FFFFFF;
					font-size: 32rpx;
					font-weight: bold;
					background-color: #ff7204;
					background: linear-gradient(-45deg, #FF6F43, #FF9C53);
					transition: all .35s;

					&:active {
						transform: scale(0.95);
					}
				}
			}
		}
</style>